#pragma warning disable 108
using System;
using System.Runtime.InteropServices;
using System.Collections.Generic;
using Cephei;
using Cephei.Core;
using Cephei.Core.Generic;
using Microsoft.FSharp.Core;
using Cephei.QL;
using Cephei.QL.Times;
using Cephei.QL.Indexes;
namespace Cephei.QL.Instruments
{
    /// <summary> 
	/// ! fixed x zero-inflation, i.e. fixed x CPI(i'th fixing)/CPI(base) versus floating + spread  Note that this does ony the inflation-vs-floating-leg. Extension to inflation-vs-fixed-leg.  is simple - just replace the floating leg with a fixed leg.  Typically there are notional exchanges at the end: either inflated-notional vs notional; or just (inflated-notional - notional) vs zero.  The latter is perhaphs more typical. \warning Setting subtractInflationNominal to true means that the original inflation nominal is subtracted from both nominals before they are exchanged, even if they are different.  This swap can mimic a ZCIIS where [(1+q)^n - 1] is exchanged against (cpi ratio - 1), by using differnt nominals on each leg and setting subtractInflationNominal to true.  ALSO - there must be just one date in each schedule.  The two legs can have different schedules, fixing (days vs lag), settlement, and roll conventions.  N.B. accrual adjustment periods are already in the schedules.  Trade date and swap settlement date are outside the scope of the instrument.
	/// </summary>
    [Guid ("2029A886-F8DB-45d6-9089-3109AB13D78E"),ComVisible(true)]
	public interface ICPISwap : Cephei.QL.Instruments.ISwap
	{
		///////////////////////////////////////////////////////////////
        // Methods
        //
        /// <summary> 
		/// 
		/// </summary>
		 Double BaseCPI {get;}
        /// <summary> 
		/// 
		/// </summary>
		 Cephei.Core.IVector<Cephei.QL.ICashFlow> CpiLeg {get;}
        /// <summary> 
		/// 
		/// </summary>
		 Double FairRate {get;}
        /// <summary> 
		/// 
		/// </summary>
		 Double FairSpread {get;}
        /// <summary> 
		/// 
		/// </summary>
		 Cephei.QL.Times.IDayCounter FixedDayCount {get;}
        /// <summary> 
		/// 
		/// </summary>
		 Cephei.QL.Indexes.IZeroInflationIndex FixedIndex {get;}
        /// <summary> 
		/// 
		/// </summary>
		 Double FixedLegNPV {get;}
        /// <summary> 
		/// 
		/// </summary>
		 QL.Times.BusinessDayConventionEnum FixedPaymentRoll {get;}
        /// <summary> 
		/// 
		/// </summary>
		 Double FixedRate {get;}
        /// <summary> 
		/// 
		/// </summary>
		 Cephei.QL.Times.ISchedule FixedSchedule {get;}
        /// <summary> 
		/// 
		/// </summary>
		 UInt32 FixingDays {get;}
        /// <summary> 
		/// 
		/// </summary>
		 Cephei.QL.Times.IDayCounter FloatDayCount {get;}
        /// <summary> 
		/// 
		/// </summary>
		 Cephei.QL.Indexes.IIborIndex FloatIndex {get;}
        /// <summary> 
		/// 
		/// </summary>
		 Cephei.Core.IVector<Cephei.QL.ICashFlow> FloatLeg {get;}
        /// <summary> 
		/// 
		/// </summary>
		 Double FloatLegNPV {get;}
        /// <summary> 
		/// 
		/// </summary>
		 QL.Times.BusinessDayConventionEnum FloatPaymentRoll {get;}
        /// <summary> 
		/// 
		/// </summary>
		 Cephei.QL.Times.ISchedule FloatSchedule {get;}
        /// <summary> 
		/// 
		/// </summary>
		 Double InflationNominal {get;}
        /// <summary> 
		/// 
		/// </summary>
		 Double Nominal {get;}
        /// <summary> 
		/// 
		/// </summary>
		 QL.Cashflows.CPI.InterpolationTypeEnum ObservationInterpolation {get;}
        /// <summary> 
		/// 
		/// </summary>
		 Cephei.QL.Times.IPeriod ObservationLag {get;}
        /// <summary> 
		/// 
		/// </summary>
		 Double Spread {get;}
        /// <summary> 
		/// 
		/// </summary>
		 Boolean SubtractInflationNominal {get;}
        /// <summary> 
		/// 
		/// </summary>
		 QL.Instruments.CPISwap.TypeEnum Type {get;}
    }   

    /// <summary> 
	/// ! fixed x zero-inflation, i.e. fixed x CPI(i'th fixing)/CPI(base) versus floating + spread  Note that this does ony the inflation-vs-floating-leg. Extension to inflation-vs-fixed-leg.  is simple - just replace the floating leg with a fixed leg.  Typically there are notional exchanges at the end: either inflated-notional vs notional; or just (inflated-notional - notional) vs zero.  The latter is perhaphs more typical. \warning Setting subtractInflationNominal to true means that the original inflation nominal is subtracted from both nominals before they are exchanged, even if they are different.  This swap can mimic a ZCIIS where [(1+q)^n - 1] is exchanged against (cpi ratio - 1), by using differnt nominals on each leg and setting subtractInflationNominal to true.  ALSO - there must be just one date in each schedule.  The two legs can have different schedules, fixing (days vs lag), settlement, and roll conventions.  N.B. accrual adjustment periods are already in the schedules.  Trade date and swap settlement date are outside the scope of the instrument. Factory
	/// </summary>
   	[ComVisible(true)]
    public interface ICPISwap_Factory 
    {
        ///////////////////////////////////////////////////////////////
        // Factory methods
        //
        /// <summary> 
		/// accrual adjustment is already in the schedules, as are calendars
		/// </summary>
	    ICPISwap Create (QL.Instruments.CPISwap.TypeEnum type, Double nominal, Boolean subtractInflationNominal, Double spread, Cephei.QL.Times.IDayCounter floatDayCount, Cephei.QL.Times.ISchedule floatSchedule, QL.Times.BusinessDayConventionEnum floatRoll, UInt32 fixingDays, Cephei.QL.Indexes.IIborIndex floatIndex, Double fixedRate, Double baseCPI, Cephei.QL.Times.IDayCounter fixedDayCount, Cephei.QL.Times.ISchedule fixedSchedule, QL.Times.BusinessDayConventionEnum fixedRoll, Cephei.QL.Times.IPeriod observationLag, Cephei.QL.Indexes.IZeroInflationIndex fixedIndex, Microsoft.FSharp.Core.FSharpOption<QL.Cashflows.CPI.InterpolationTypeEnum> observationInterpolation, Microsoft.FSharp.Core.FSharpOption<Double> inflationNominal, Cephei.QL.IPricingEngine QL_Pricer);
    }
}

